package main

import "fmt"

// //函数外hort declaration and initialization会报错，只能在函数内使用
// price := 2.50

// //可以在函数外声明
// var price = 2.50
func main() {

	// Declare and initialize with var with explicit type
	var coffeeName string = "Espresso"
	// Type inferred
	var size = "Small"
	// //Declare and initialize with var with explicit type
	// var price float64 = 2.50

	// Short declaration and initialization. Possible only inside functions
	price := 2.50

	fmt.Println("Small Espresso price is $2.50")
	fmt.Println(size, coffeeName, "price is $", price)
	fmt.Printf("%s %s price is $%f\n", size, coffeeName, price)
	fmt.Printf("%s %s price is $%.2f\n", size, coffeeName, price)

}
